CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )

SET( PROJECT_NAME_TEMP "DiolLib" )

INCLUDE( FindDirectInput.cmake )

#MESSAGE("DirectInput:")
#MESSAGE("Found:	${DIRECTINPUT_FOUND}")
#MESSAGE("Include: ${DirectInput_INCLUDE_DIR}")
#MESSAGE("Libs: ${DirectInput_LIBRARIES}")

IF( DIRECTINPUT_FOUND )
	
	PROJECT( ${PROJECT_NAME_TEMP} )
	
	ADD_DEFINITIONS( -DUNICODE -D_UNICODE )		

	INCLUDE_DIRECTORIES( ${DirectInput_INCLUDE_DIR} )

	SET	(	SOURCES
			DiolCommon.h
			DiolCommon.cpp
			
			DiolTime.h
			DiolTime.cpp
			
			DiolObjectInstance.h
			DiolObjectInstance.cpp
			DiolObject.h
			DiolObject.cpp
			DiolButton.h
			DiolButton.cpp
			DiolAxis.h
			DiolAxis.cpp
			DiolPOV.h
			DiolPOV.cpp
			
			DiolDeviceInstance.h
			DiolDeviceInstance.cpp
			DiolDevice.h
			DiolDevice.cpp
			
			DiolDeviceEnumerationTrigger.h
			DiolDeviceEnumerationTrigger.cpp
			DiolDeviceManager.h
			DiolDeviceManager.cpp
		)
	ADD_LIBRARY( ${PROJECT_NAME} STATIC ${SOURCES} )
	TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${DirectInput_LIBRARIES} )

ELSE()

	MESSAGE("Can't find DirectInput library. Project ${PROJECT_NAME_TEMP} won't be compiled")

ENDIF()